package ferp.core.state;

import ferp.core.game.Game;
import ferp.core.game.Input;
import ferp.core.game.Settings;
import ferp.core.player.Profile;

/**
 * User: igorgok
 * Date: 10/22/11 9:52 PM
 */
class GetInputOptions extends State
{
  @Override
  public int process(Game.Listener listener, Profile profile, Game g, Settings settings, Input input) throws Game.Error
  {
    // clear old options before getting the new ones
    g.options.clear();

    // get input options
    int r = g.mode().fill(listener, g, settings, input);

    // next state will be "processing" if not changed by process() method
    if (g.state() == this)
      g.set(State.process);

    return r;
  }
}
